package io.gitee.tianhaoran.chat.sdk.provider.chatgpt.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.gitee.tianhaoran.chat.sdk.provider.chatgpt.model.enums.ChatModel;
import lombok.*;
import lombok.extern.slf4j.Slf4j;
import io.gitee.tianhaoran.chat.sdk.api.entity.chat.Message;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 作者：沈自在
 **/
@Data
@Slf4j
@JsonInclude(JsonInclude.Include.NON_NULL)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ChatgptCompletionRequest implements Serializable {

    /**
     * 默认模型
     */
    private String model = ChatModel.GPT_3_5_TURBO.getValue();

    /**
     * 问题描述
     */
    private List<Message> messages;

    /**
     * 控制温度
     */
    private Double temperature = 0.2;

    /**
     *
     */
    @JsonProperty("top_p")
    private Double topP = 1d;

    /**
     * 次数
     */
    private Integer n = 1;

    /**
     * 是否为流式输出
     */
    private Boolean stream = Boolean.FALSE;

    /**
     * 停止输出标识
     */
    private List<String> stop;

    /**
     * 最大字符
     */
    @JsonProperty("max_tokens")
    private Integer maxTokens = 2048;

    /**
     * 频率惩罚
     */
    @JsonProperty("frequency_penalty")
    private Double frequencyPenalty = 0D;

    /**
     * 存在惩罚
     */
    @JsonProperty("presence_penalty")
    private Double presencePenalty = 0D;

    /**
     *
     */
    @JsonProperty("logit_bias")
    private Map logitBias;

    /**
     *
     */
    private String user;
}
